package org.example.controller;

import lombok.RequiredArgsConstructor;
import org.example.Result;
import org.example.service.UserService;
import org.example.sso.model.entity.UserDO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @GetMapping("/get")
    public Result<UserDO> getUser(@RequestParam("id") Long id) {
        return Result.success(userService.getUser(id));
    }
}
